#include <iostream>
#include <memory>

using std::cout;
using std::endl;
using std::unique_ptr;
using std::shared_ptr;

void test()
{
    unique_ptr<int> up(new int(10));
    unique_ptr<int> up2(new int(20));
    up.reset(up2.get());
}

void test2()
{
    shared_ptr<int> sp(new int(10));
    shared_ptr<int> sp2(new int(20));
    sp.reset(sp2.get());
}
int main(int argc, char *argv[])
{
    test2();
    return 0;
}

